<!DOCTYPE html>
<html>

<head>
	<title>留言</title>
	<meta charset="UTF-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="format-detection" content="telephone=no" />
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<script src="js/jquery-1.8.3.min.js?v=1"></script>
	<script src="js/jquery.imgpreload.js?v=1"></script>
</head>

<body>
	<div style="position: absolute;width: 100%;height: 100%;background: white;text-align: center;">
		<h3 style="text-align: left;padding: 1.5rem;">留言板:</h3>
		<textarea id="msgTextarea" style="width: 90%;height: 30%;border: 1px solid black;border-radius: 5px;outline: none;padding: 5px;" type="text" rows="3" cols="20"></textarea>
		<button id="send" style="width: 20%; font-size: 16px;background: white;border: 1px solid gray;border-radius: 5px;padding: 2px;margin-top: 1.2rem;">提交</button>
	</div>

	<style type="text/css">
	* {
		margin: 0;
		padding: 0;
	}
	</style>

	<script>
	$("#send").on('click', function() {
		console.log("####");
		$.ajax( {
			type: "post", url: "http://www.dasvidaniyalife.com:3000/comment", async: true, data: {
				name: $("#msgTextarea").val()
			}
			, success: function(e) {
				$(".msgBox").hide();
				$(".msgBoxButton").show();
				$("#msgTextarea").val('');
				alert("提交成功");
				window.history.go(-1) 
			}
		}
		);
	}
	)
	</script>
</body>

</html>